﻿using System;

namespace CodeCamp.Controllers
{
  public static class EventsHelper
  {
    public static int GetEventId( string eventName )
    {
      var repository = new CodeCampDataRepository();
      var @event = repository.GetEvent( eventName );
      if ( @event == null )
        throw new Exception( "Event not found" );

      return @event.Id;
    }
  }
}